/**
 * Output:
 *  4 lines helloooo...
 * 	10
 * @author M.O
 *	Khong hieu cai doan if kia lam gi ?
 * 		1. Neu nhieu if cho 1 bien thi dung if else if cho tien
 * 		2. Cai dieu kien kia hoi buon cuoi, the x > 1 thi thang e2 duoc set 2 lan ha :/
 * 	# Chac la viet linh tinh. :)
 */
public class EchoTestDrive {
	public static void main(String[] args) {
		Echo e1 = new Echo();
		Echo e2 = new Echo();
		
		int x = 0; 
		while (x < 4) {
			e1.hello();
			// Nhu da noi tu truoc, khong nen choc thang vao bien ntn (tai no protected nen moi lam dc)
			// Nhung tao tac voi attributes thi nen thong qua ham get/set
			e1.setCount(e1.getCount() + 1);

			if (x > 0) {
				e2.setCount(e2.getCount() + 1);
			}
			if (x > 1) {
				e2.setCount(e2.getCount() + e1.getCount());
			}
			
			x = x + 1;
		}
		System.out.println(e2.count);
	}
}
